package util;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class SessionFactorySingleton {
	private static SessionFactorySingleton instance;
	private static SessionFactory sessionFactory = null;
	private SessionFactorySingleton(){
		
	}
	public static SessionFactorySingleton getInstance(){
		if(instance==null){
			sessionFactory=new AnnotationConfiguration().configure().buildSessionFactory();
			instance = new SessionFactorySingleton();
		}
		return instance;
	}
	public static SessionFactory getSesssionFactory(){
		return sessionFactory;
	}
	
	
}
